import * as THREE from "three";
import Experience from "../Experience";
import Enviroment from "./Enviroment";
export default class World {
  constructor() {
    this.experience = Experience.instance;
    this.scene = this.experience.scene;
    this.resources = this.experience.resources;

    this.camera = this.experience.camera;
    this.renderer = this.experience.renderer;
    this.canvas = this.experience.canvas;
    this.time = this.experience.time;
    this.sizes = this.experience.sizes;

    const cubeMesh = new THREE.Mesh(
      new THREE.BoxGeometry(1, 1, 1),
      new THREE.MeshStandardMaterial()
    );
    cubeMesh.position.set(0, 0, 0);
    this.scene.add(cubeMesh);

    this.resources.on('ready',()=>{
        console.log('资源加载完毕');
        this.enviroment = new Enviroment();//放在这里，等资源加载完再打灯光
    })
    //this.enviroment = new Enviroment();//放在这里，一边先打灯光
  }
}
